﻿<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
					   xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
					   x:Class="CalciumTemplateApp.Views.OptionsView"
			 xmlns:local="clr-namespace:CalciumTemplateApp;assembly=CalciumTemplateApp"
			 xmlns:options="clr-namespace:CalciumTemplateApp.Views.Options;assembly=CalciumTemplateApp"
			 xmlns:calcium="clr-namespace:Outcoder.UI.Xaml;assembly=Outcoder.Calcium">
	<Grid Padding="5, 25" VerticalOptions="FillAndExpand">
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="0" />
		</Grid.RowDefinitions>
		
		<ListView ItemsSource="{Binding Groupings}" 
				  HasUnevenRows="true" IsGroupingEnabled="true"
				  VerticalOptions="FillAndExpand" Grid.Row="0">
			<ListView.GroupHeaderTemplate>
				<DataTemplate>
					<ViewCell>
						<Label Text="{Binding Key.Title}" />
					</ViewCell>
				</DataTemplate>
			</ListView.GroupHeaderTemplate>
			<ListView.ItemTemplate>
				<DataTemplate>
					<options:OptionTemplateSelector />
				</DataTemplate>
			</ListView.ItemTemplate>
		</ListView>

		<calcium:AppBar Grid.Row="1">
			<calcium:AppBar.Buttons>
				<calcium:AppBarItem Command="{Binding ExampleCommand}" 
									Text="{Binding ExampleCommand.Text}" />
			</calcium:AppBar.Buttons>
		</calcium:AppBar>
	</Grid>
</ContentView>